package algo3c3g3.model;

import algo3c3g3.model.material.*;

/**
 * Clase contenedora de varias clases de prueba para generar mapas una dimension
 * y bloques especificos, usados para probar las diferentes clases de acciones y materiales.
 */
public abstract class TestMaps
{
    /*
     * Mapas de prueba con bloques de distintas dimensiones y combinaciones de materiales.
     */
    
    public static class TestWalkerMap extends WorldMap
    {
        public TestWalkerMap()
        {
            super(20, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                //replaceBlock(x, 5, MaterialFactory.getInstance(Material.AIR));
                replaceBlock(x, 5, MaterialFactory.getInstance(Material.AIR));
        }
    }

    public static class TestFallerMap extends WorldMap
    {
        public TestFallerMap()
        {
            super(20, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 2, MaterialFactory.getInstance(Material.AIR));

            for(int y = 1; y < getHeight() - 1; y++)
                replaceBlock(10, y, MaterialFactory.getInstance(Material.AIR));
        }
    }

    public static class TestBasherMap extends WorldMap
    {
        public TestBasherMap()
        {
            super(20, 10);

            fillMap();

            replaceBlock(2, 5, MaterialFactory.getInstance(Material.AIR));
            replaceBlock(18, 5, MaterialFactory.getInstance(Material.AIR));
            replaceBlock(19, 5, MaterialFactory.getInstance(Material.ROCK));
            replaceBlock(0, 5, MaterialFactory.getInstance(Material.ROCK));
        }
    }

    public static class TestDiggerMap extends WorldMap
    {
        public TestDiggerMap()
        {
            super(10, 20);

            fillMap();

            replaceBlock(5, 1, MaterialFactory.getInstance(Material.AIR));

            for(int y = 10; y < 18; y++)
                replaceBlock(5, y, MaterialFactory.getInstance(Material.AIR));
        }
    }

    public static class TestBuilderMap extends WorldMap
    {
        public TestBuilderMap()
        {
            super(20, 10);

            fillMap();

            for(int y = 1; y < getHeight() - 1; y++)
                for(int x = 1; x < getWidth() - 1; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
        }
    }

    public static class TestIceMap extends WorldMap
    {
        public TestIceMap()
        {
            super(20, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 5, MaterialFactory.getInstance(Material.AIR));

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 6, MaterialFactory.getInstance(Material.ICE));
        }
    }

    public static class TestFireMap extends WorldMap
    {
        public TestFireMap()
        {
            super(20, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 5, MaterialFactory.getInstance(Material.AIR));

            for(int x = 5; x < getWidth() - 1; x++)
                replaceBlock(x, 6, MaterialFactory.getInstance(Material.ROCK));
        }
    }
    
    public static class TestTeleporterMap extends WorldMap
    {
        public TestTeleporterMap()
        {
            super(30, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 5, MaterialFactory.getInstance(Material.AIR));
        }
    }
    
    public static class TestUpDownHillMap extends WorldMap
    {
        public TestUpDownHillMap()
        {
            super(30, 10);

            fillMap();

            for(int x = 1; x < getWidth() - 1; x++)
                replaceBlock(x, 1, MaterialFactory.getInstance(Material.AIR));
            
            for(int x = 6; x < getWidth() - 1; x++)
                replaceBlock(x, 2, MaterialFactory.getInstance(Material.AIR));
            
            for(int x = 12; x < getWidth() - 1; x++)
                for(int y = 3; y < getHeight() - 1; y++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            
            replaceBlock(16, 8, MaterialFactory.getInstance(Material.ROCK));
            replaceBlock(17, 7, MaterialFactory.getInstance(Material.ROCK));
            replaceBlock(18, 6, MaterialFactory.getInstance(Material.ROCK));
            replaceBlock(19, 5, MaterialFactory.getInstance(Material.ROCK));
            
            for(int x = 20; x < getWidth() - 1; x++)
                replaceBlock(x, 4, MaterialFactory.getInstance(Material.ROCK));
            
            replaceBlock(25, 3, MaterialFactory.getInstance(Material.ROCK));
            replaceBlock(25, 2, MaterialFactory.getInstance(Material.ROCK));
        }
    }
    
    public static class TestMap extends WorldMap
    {
        public TestMap()
        {
            super(50, 37);

            fillMap();

            for(int y = 1; y < 10; y++)
                for(int x = 1; x < 20; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            for(int y = 12; y < 16; y++)
                for(int x = 1; x < 20; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            for(int y = 18; y < 23; y++)
                for(int x = 1; x < 20; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            for(int y = 2; y < 12; y++)
                for(int x = 25; x < 49; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            
                for(int x = 25; x < 49; x++)
                    replaceBlock(x, 12, MaterialFactory.getInstance(Material.FIRE));
            
            for(int y = 18; y < 30; y++)
                for(int x = 25; x < 49; x++)
                    replaceBlock(x, y, MaterialFactory.getInstance(Material.AIR));
            
            for(int x = 30; x < 49; x++)
                replaceBlock(x, 29, MaterialFactory.getInstance(Material.ROCK));
            for(int x = 31; x < 49; x++)
                replaceBlock(x, 28, MaterialFactory.getInstance(Material.ROCK));
            for(int x = 32; x < 49; x++)
                replaceBlock(x, 27, MaterialFactory.getInstance(Material.ROCK));
            for(int x = 33; x < 49; x++)
                replaceBlock(x, 26, MaterialFactory.getInstance(Material.ROCK));
            for(int x = 34; x < 49; x++)
                replaceBlock(x, 25, MaterialFactory.getInstance(Material.ROCK));
            for(int x = 35; x < 49; x++)
                replaceBlock(x, 24, MaterialFactory.getInstance(Material.ROCK));
        }
    }
}
